import Vue from 'vue'
import Router from 'vue-router'
import HomeContainer from '../components/tabbar/HomeContainer.vue'
import MemberContainer from '../components/tabbar/MemberContainer.vue'
import ShopcarContainer from '../components/tabbar/ShopcarContainer.vue'
import SearchContainer from '../components/tabbar/SearchContainer.vue'
import newsList from '../components/news/NewsList.vue'
import newsInfo from '../components/news/newsInfo.vue'
import photoList from '../components/photos/photosList.vue'
import photoInfo from '../components/photos/photoInfo.vue'
import goodsList from '../components/goods/goodsList.vue'
import GoodsInfo from '../components/goods/GoodsInfo.vue'
import GoodsDesc from '../components/goods/GoodsDesc.vue'
import goodsComment from '../components/goods/GoodsComment.vue'

Vue.use(Router)
var router = new Router({
    routes: [//配置路由规则  这里要注意是 routes!! routes!! routes!! routes!! routes!!
        { path: '/', redirect: '/home' },
        { path: '/home', component: HomeContainer },
        { path: '/member', component: MemberContainer },
        { path: '/shopcar', component: ShopcarContainer },
        { path: '/search', component: SearchContainer },
        { path: '/home/newslist', component: newsList },
        { path: '/home/photolist', component: photoList },
        { path: '/home/newsinfo/:id', component: newsInfo },
        { path: '/home/photoInfo/:id', component: photoInfo },
        { path: '/home/goodslist', component: goodsList },
        { path: '/home/GoodsInfo/:id', component: GoodsInfo },
        { path: '/home/goodsdesc/:id', component: GoodsDesc,props:true,name: 'goodsdesc'},
        { path: '/home/GoodsComment/:id', component: goodsComment,props:true,name: 'goodsComment'}
    ],
    linkActiveClass: 'mui-active' //覆盖默认的路由高亮的类active，默认的类叫做router-link-active
})

export default router

//把路由对象暴露出去
